<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:c="http://java.sun.com/jstl/core"
		xmlns:itdep="http://itdep.bsuir.by/jsf"
		>
	<ui:composition>
		<f:loadBundle basename="bundle.common" var="commonBundle"/>
		<rich:panel id="#{idPrefix}TablePanel" styleClass="transparent" bodyClass="noPadding">
			<a4j:form>
				<a4j:commandLink value="#{commonBundle.add}" action="#{actionBean.add}" reRender="#{idPrefix}TablePanel"
								 rendered="#{not actionBean.editMode}"/>
			</a4j:form>
			<a4j:form enctype="multipart/form-data">
				<rich:panel id="#{idPrefix}AddPanel" rendered="#{actionBean.editMode}">
					<f:facet name="header">
						<h:panelGroup>
							<h:outputText value="#{commonBundle.adding} _#{idPrefix}_"
										  rendered="#{actionBean.record.new}"/>
							<h:outputText value="#{commonBundle.editing} _#{idPrefix}_"
										  rendered="#{!actionBean.record.new}"/>
						</h:panelGroup>
					</f:facet>
					<ui:insert name="editPanelContext"/>
					<br/>
					<a4j:commandButton value="#{commonBundle.save}" action="#{actionBean.save}"
									   reRender="#{idPrefix}TablePanel"/>
					<a4j:commandButton value="#{commonBundle.cancel}" action="#{actionBean.cancel}"
									   reRender="#{idPrefix}TablePanel" immediate="true"/>
					<h:commandButton value="#{commonBundle.reset}" type="reset" rendered="false"/>
				</rich:panel>
			</a4j:form>
			<a4j:form enctype="multipart/form-data">
				<rich:dataTable id="#{idPrefix}Table" width="100%" headerClass="dr-table-header"
								onRowMouseOver="this.style.backgroundColor='#f1f1f1';"
								onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}';"
								var="record" value="#{actionBean.dataModel}" binding="#{actionBean.tableBinding}">
					<ui:insert name="tableContext"/>
					<rich:column id="#{idPrefix}Column" width="1%">
						<f:facet name="header">
							<h:outputText value="#{commonBundle.action}"/>
						</f:facet>
						<h:panelGroup id="#{idPrefix}TemplatePanelGroup" style="white-space:nowrap;">
							<a4j:commandLink id="#{idPrefix}CommandLinkEdit" value="#{commonBundle.edit}"
											 action="#{actionBean.edit}" reRender="#{idPrefix}TablePanel"
											 immediate="true"/>
							<rich:spacer width="7"/>
							<a4j:commandLink id="#{idPrefix}CommandLinkDelete" value="#{commonBundle.delete}"
											 action="#{actionBean.delete}" reRender="#{idPrefix}TablePanel"
											 immediate="true"/>
						</h:panelGroup>
					</rich:column>
				</rich:dataTable>
			</a4j:form>
		</rich:panel>
	</ui:composition>
</f:view>